Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-31203: Fixed wrong connection being used for database creation when SiteAccess option is used #2908

Merged
merged 4 commits into from
Jan 16, 2020

Conversation

mateuszbieniek
Copy link
Contributor

This PR is a followup for #2900 which adds an additional connection parameter for doctrine:database-create so correct database is created when ezplatform:install command is executed using SiteAccess with connection different than default.

@adamwojs adamwojs changed the title EZP31203 - Fixed wrong connection being used for database creation when siteaccess option is used EZP-31203 - Fixed wrong connection being used for database creation when siteaccess option is used Jan 6, 2020
@alongosz alongosz changed the title EZP-31203 - Fixed wrong connection being used for database creation when siteaccess option is used EZP-31203: Fixed wrong connection being used for database creation when SiteAccess option is used Jan 7, 2020
@andrerom
Copy link
Contributor

andrerom commented Jan 7, 2020

Instead of the constants and the private method here. Wouldn't it be more readable and simplify the code if we simply expose a $this->repositoryConfigurationProvider->getConnectionName(); method.

It's not like this is the only place that we will have to deal with this afaik :)

WDYT @adamwojs ?

@adamwojs
Copy link
Member

adamwojs commented Jan 7, 2020

Instead of the constants and the private method here. Wouldn't it be more readable and simplify the code if we simply expose a $this->repositoryConfigurationProvider->getConnectionName(); method.

@andrerom I agree.

@mnocon
Copy link
Member

mnocon commented Jan 16, 2020

@mateuszbieniek Travis is failing with:

> @php bin/console ezplatform:install clean

Creating the database ezp if it does not exist, executing command doctrine:database:create --if-not-exists

In RepositoryConfigurationProvider.php line 62:

                                                                               

  Type error: Return value of eZ\Bundle\EzPublishCoreBundle\ApiLoader\Reposit  

  oryConfigurationProvider::getStorageConnectionName() must be of the type st  

  ring, null returned    

Probably related to this PR, could you have a look?

@mateuszbieniek
Copy link
Contributor Author

@mateuszbieniek Travis is failing with:

> @php bin/console ezplatform:install clean

Creating the database ezp if it does not exist, executing command doctrine:database:create --if-not-exists

In RepositoryConfigurationProvider.php line 62:

                                                                               

  Type error: Return value of eZ\Bundle\EzPublishCoreBundle\ApiLoader\Reposit  

  oryConfigurationProvider::getStorageConnectionName() must be of the type st  

  ring, null returned    

Probably related to this PR, could you have a look?

Yup - for some reason, with default configuration connection name that is returned is null (⊙.☉)7

Copy link
Member

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now! Tested with default repository and custom configurations.
Also verified using patches on kernel 7.5.6 (first applying patch from #2900 for 7.5)

@lserwatka lserwatka merged commit a366ffd into ezsystems:7.5 Jan 16, 2020
@lserwatka
Copy link
Member

Could you merge it up?

@mateuszbieniek
Copy link
Contributor Author

@lserwatka done a366ffd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants